package com.bingbing.back.controller;

import com.bingbing.back.po.EchartsArea;
import com.bingbing.back.po.EchartsIndustry;
import com.bingbing.back.po.EchartsJob;
import com.bingbing.back.po.EchartsProspect;
import com.bingbing.back.service.EchartsService;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@CrossOrigin
@RestController
@RequestMapping("/echarts")
public class EchartsController {
    @Resource
    private EchartsService echartsService;

    /**
     * 返回echarts就业行业分布图的数据
     * @param majorId
     * @return 返回industry行业名称，ratio比率
     */
    @RequestMapping("/showIndustryById")
    List<EchartsIndustry> showIndustryById(int majorId){
        return echartsService.showIndustryById(majorId);
    }

    /**
     * 返回echarts就业岗位分布图的数据
     * @param majorId
     * @return 返回job岗位名称，detailJob详细工作，industry所在行业，ratio比率
     */
    @RequestMapping("/showJobById")
    List<EchartsJob> showJobById(int majorId){
        return echartsService.showJobById(majorId);
    }

    /**
     * 返回echarts就业地区分布图的数据
     * @param majorId
     * @return 返回area地区名称，ratio比率
     */
    @RequestMapping("/showAreaById")
    List<EchartsArea> showAreaById(int majorId){
        return echartsService.showAreaById(majorId);
    }

    /**
     * 返回echarts专业就业发展前景的数据
     * @param majorId
     * @return 返回prospect专业就业发展前景
     */
    @RequestMapping("/showProspectById")
    List<EchartsProspect> showProspectById(int majorId){
        return echartsService.showProspectById(majorId);
    }
}
